<?php
namespace App\Admin\Controller;

use \Foxforms\Widget\Form;
use \Foxforms\Widget\Field\Input;

class telefoneController extends \Foxframe\Controller
{
	public function deletarTelefone($params = array())
	{
		try
		{
			$telefone = $this->em->find('\Entities\Corp\Telefone', $params['id']);
			$this->em->remove($telefone);
			$this->em->flush();

			echo "Sucesso";
		}
		catch (\Exception $e)
		{
 			$erro = $this->setFlash('Error', 'Erro ao excluir '.$telefone->getNumero(), $e->getMessage());
			echo header("HTTP/1.0 400 ".utf8_encode($erro));
		}
		exit;
	}

}